#ifndef __HIKARI_EVENT_RECEIVER__
#define __HIKARI_EVENT_RECEIVER__

#include "hikari.h"

class HikariEventReceiver:public IEventReceiver{
public:
	HikariEventReceiver();

	~HikariEventReceiver(void);

    virtual bool OnEvent(const SEvent& event);

	virtual void setEnabled(bool enabled){
		this->enabled=enabled;
	}

	virtual bool isEnabled(){
		return enabled;
	}

    virtual bool IsKeyDown(EKEY_CODE keyCode) {
        return KeyIsDown[keyCode];
    }

	virtual bool IsKeyPressed(EKEY_CODE keyCode) {
		bool keyPressed=KeyIsPressed[keyCode];
		KeyIsPressed[keyCode]=false;
		return keyPressed;
    }

	virtual bool IsKeyReleased(EKEY_CODE keyCode) {
		bool keyReleased=KeyIsReleased[keyCode];
		KeyIsReleased[keyCode]=false;
		return keyReleased;
    }

	virtual void processMouseSpeed();

	virtual bool isLeftMouseButtonDown(){
		return lMouseButtonState;
	}

	virtual bool isRightMouseButtonDown(){
		return rMouseButtonState;
	}

	virtual bool isMiddleMouseButtonDown(){
		return mMouseButtonState;
	}

	virtual bool isLeftMouseButtonPressed(){
		bool val=lMousePressed;
		lMousePressed=false;
		return val;
	}

	virtual bool isRightMouseButtonPressed(){
		bool val=rMousePressed;
		rMousePressed=false;
		return val;
	}

	virtual bool isMiddleMouseButtonPressed(){
		bool val=mMousePressed;
		mMousePressed=false;
		return val;
	}

	int getMouseXPosition(){
		return mouseX;
	}

	int getMouseYPosition(){
		return mouseY;
	}

	float getMouseWheel(){
		return mouseWheel;
	}

	int getMouseSpeedX(){
		return mouseSpeedX;
	}

	int getMouseSpeedY(){
		return mouseSpeedY;
	}
    

private:
    bool KeyIsDown[KEY_KEY_CODES_COUNT];
	bool KeyIsPressed[KEY_KEY_CODES_COUNT];
	bool KeyIsReleased[KEY_KEY_CODES_COUNT];
	bool lMouseButtonState;
	bool rMouseButtonState;
	bool mMouseButtonState;
	bool lMousePressed;
	bool rMousePressed;
	bool mMousePressed;
	int mouseX;
	int mouseY;
	f32 mouseWheel;
	int mouseSpeedX;
	int mouseSpeedY;

	int lastMouseX;
	int lastMouseY;

	bool enabled;
};


#endif